# coding=UTF-8
from package_run.run2 import run2
from package_run.run1 import run1

run1()
run2()

# 26 输入  input 与raw_input
# print("Python 是最好的语言")
#
# str = input("请输入:")
# print("您输入的是:" + str)
#
# for tiny in range(2, 10, 2):
#     print(tiny * 5)

# 27 写入文件
file = open("file.txt", "w")
# file1 = open("file1.txt", "w")  # 创建一个空的.txt文件
# # file.write("https://www.baidu.com")
# file.close()  # 关闭文件
# print("是否关闭:", file.closed)
# print("文件名字:", file.name)
# print("模式:", file.mode)
#
# # 28  读取文件
# file = open("file.txt", "r+")
# read1 = file.read(12)
# print("文件位置:", file.tell())
# file.close()
# print("是否关闭:", file.closed)
# print("读取的内容:", read1)

import os

# 更改文件名
# os.rename("file.txt", "refile.txt")

# os.remove("file1.txt")
# 创建一个文件夹
# os.mkdir("newdir")
# os.chdir("newdir")
# 文件路径
print(os.getcwd(), file.name)

# 异常捕获
try:
    fileDoc = open("refile.txt", "w")
    fileDoc.write("我是测试数据")
except IOError:
    print("写入异常")
else:
    print("写入成功")
    fileDoc.closed
